home *** CD-ROM | disk | FTP | other *** search
- /***
- *dirent.h - struct/function declarations for directory handling
- *
- * Copyright (c) 1993-1994, Gregg Jennings. All wrongs reserved.
- *
- *Purpose:
- * This include file contains the function declarations and structure
- * declarations for the functions related to directory handling.
- *
- ****/
-
- /*
- Versions:
-
- 1.1 13-Nov-1993 DosTime and DosDate entries were backward.
- Attribute is as well but I havent used it yet,
- there may be alignment problems with it as well.
- 1.0 June 1993
- */
-
- #ifndef GENERAL_H
- #include "general.h"
- #endif
-
- #ifndef _DIR_DEFINED
-
- #pragma pack(1)
-
- typedef struct file_attributes {
- unsigned rdonly:1;
- unsigned hidden:1;
- unsigned system:1;
- unsigned volume:1;
- unsigned subdir:1;
- unsigned archiv:1;
- unsigned unused:2;
- unsigned reserved:8; /* must align as word */
- } Attribute;
-
- typedef struct file_time {
- unsigned seconds:5;
- unsigned minutes:6;
- unsigned hours:5;
- } DosTime;
-
- typedef struct file_date {
- unsigned day:5;
- unsigned month:4;
- unsigned year:7;
- } DosDate;
-
- struct DIR {
- byte name[8];
- byte ext[3];
- Attribute attr;
- byte reserved[9]; /* NOTE: reserved byte held by Attribute */
- DosTime time;
- DosDate date;
- word start;
- dword size;
- };
-
- struct xDIR {
- byte ff;
- byte reserved0[5];
- byte a;
- byte d;
- byte name[8];
- byte ext[3];
- Attribute attr;
- byte reserved[9]; /* NOTE: reserved byte held by Attribute */
- DosTime time;
- DosDate date;
- word start;
- dword size;
- };
-
- struct FCB {
- byte drive;
- byte name[8];
- byte ext[3];
- word blkno;
- word recsz;
- dword size;
- word date;
- word time;
- byte reserved[8];
- byte recno;
- dword recnum;
- };
-
- struct xFCB {
- byte ff;
- byte reserved1[5];
- byte a;
- byte drive;
- byte name[8];
- byte ext[3];
- word blkno;
- word recsz;
- dword size;
- word date;
- word time;
- byte reserved[8];
- byte recno;
- dword recnum;
- };
-
- #define _DIR_DEFINED
- #endif
-
- extern int changedir(unsigned char *buf,int sec_size);
- extern void dumpdir(unsigned char *buf,int sec_size);
-